package com.csd.dto;

import java.util.List;

/**
 * @program: CeSuDi_SSM
 * @author: qinjianbao
 * @create: 2020-12-24 17:03
 * @Version: 1.0
 */
public class PageBean <T>{

    private int currentPage;//当前页码
    private int pageSize=5;//每页显示的条数
    private int toalCount;//总记录数
    private int totalPage;//总页数
    private List<T> list;///页面中的列表数据


    public PageBean() {
        super();
    }
    public PageBean(int currentPage, int pageSize, int toalCount,  List<T> list) {
        super();
        this.currentPage = currentPage;
        this.pageSize = pageSize;
        this.toalCount = toalCount;
        this.list = list;
    }
    public int getCurrentPage() {
        return currentPage;
    }
    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }
    public int getPageSize() {
        return pageSize;
    }
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
    public int getTotalCount() {
        return toalCount;
    }
    public void setToalCount(int toalCount) {
        this.toalCount = toalCount;
    }
    //计算
    public int getTotalPage() {
        return (int) Math.ceil(toalCount*1.0/pageSize);
    }
    public void setToalPage(int totalPage) {
        this.totalPage = totalPage;
    }
    public List<T> getList() {
        return list;
    }
    public void setList(List<T> list) {
        this.list = list;
    }
    @Override
    public String toString() {
        return "PageBean [currentPage=" + currentPage + ", pageSize=" + pageSize + ", toalCount=" + toalCount
                + ", toalPage=" + totalPage + ", list=" + list + "]";
    }


}
